# -*- coding: utf-8 -*-
"""
Created on Tue Mar 14 09:53:06 2017

@author: g
"""

import re
print("\n9------批量重命名------\n")
originalName = r"NNN+20165133286875++_050601J02-001_A_A4_.zip" #原文件名
p1 = r"(\d+).+?(\d+\S\d\d).+?(\.\S+)" #匹配规则1
pattern1 = re.compile(p1)#按照匹配规则1编译这段正则表达式
matcher1 = re.search(pattern1,key)#在源文本中搜索符合正则表达式的部分
#print("1:",matcher1.string) #打印出来
#print("2:",matcher1.group(0)) #打印出来
#print("3:",matcher1.group(1)) #打印出来
#print("4:",matcher1.group(2)) #打印出来
#print("5:",matcher1.group(3)) #打印出来
nowName=matcher1.group(2)+matcher1.group(3)
print("新名字:",nowName) #打印出来